package com.epfly.promo.activity.dao;

import com.epfly.promo.activity.entity.ActivityStoreEntity;
import org.apache.ibatis.annotations.*;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;
@Mapper
public interface ActivityStoreMapper extends BaseMapper<ActivityStoreEntity>, InsertListMapper<ActivityStoreEntity> {



    @ResultMap(value = "activityStoreMapperBaseResultMap")
    @Select(value = "select store_id from tbl_activity_store where activity_id = #{activityId} and del_flag = 0")
    List<ActivityStoreEntity> findByActivityId(@Param(value = "activityId") Long activityId);

    @Delete(value = "delete from tbl_activity_store where activity_id = #{activityId} and del_flag = 0 ")
    int deleteByActivityId(@Param(value = "activityId") Long activityId);


    List<ActivityStoreEntity> findByActivityIdListAndStoreIdList(@Param(value = "activityIdList") List<String> activityIdList,
                                                                 @Param(value = "scoreIdList") List<String> scoreIdList);
}
